﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Work.BL.Managers;
using Work.UI.Web.Forms.Code.Common;

namespace Work.UI.Web.Forms.Admin.Employees
{
    public partial class Edit : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void odsEmployee_ObjectCreating(object sender, ObjectDataSourceEventArgs e)
        {
            IProfileEmployeeManager employeeManager = IoCContainer.ServiceLocator.Resolve<IProfileEmployeeManager>();
            e.ObjectInstance = employeeManager;
        }

        protected void frvEmployee_ItemUpdate(object sender, FormViewUpdatedEventArgs e)
        {
            Response.Redirect("~/Admin/Employees/Default.aspx");
        }

        protected void AddEmployee_Click(object sender, EventArgs e)
        {
            frvEmployee.UpdateItem(true);
        }

        protected void Cansel_Click(object sender, EventArgs e)
        {
            Response.Redirect("~/Admin/Employees/Default.aspx");
        }
    }
}